package cn.scau.server.controller;

import cn.scau.server.dto.MobileLoginFormDTO;
import cn.scau.server.dto.PCLoginFormDTO;
import cn.scau.server.service.PCUserService;
import cn.scau.server.vo.ResultVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/pcUser")
public class PCUserController {
    @Autowired
    private PCUserService pcUserService;

    @ApiOperation("pc端登录")
    @PostMapping("/login")
    public ResultVO login(@RequestBody PCLoginFormDTO loginForm, HttpSession session){
        return pcUserService.login(loginForm,session);
    }

    @ApiOperation("数据存储")
    @GetMapping("/getAdminInfo")
    public ResultVO getAdminInfo(@RequestParam String account){
        return pcUserService.getAdminInfo(account);
    }
}
